<template>
  <div>Home</div>
  <span>展示count ： {{ $store.state.count }}</span>
  <br />
  <button @click="$store.commit('increment')">提交commit</button>
  <br />
  <button @click="btnClickA">派发action</button>
  <br />
  <button @click="btnClickS">派发action + 10</button>
</template>

<script>
import { useStore } from 'vuex'
export default {
  methods: {
    btnClickA() {
      this.$store.dispatch('incrementAction')
    },
  },
  setup() {
    const store = useStore()
    const btnClickS = () => {
      console.log(2)
      store.dispatch('incrementAction', 10)
    }
    return {
      btnClickS,
    }
  },
}
</script>

<style lang="scss" scoped></style>
